@extends('wap.layouts.master')
@section('title','修改资料')

@section('content')

<div class="aw-main aw-user aw-user-info" id="Form-team_edit">
	<!--表单-开始-->
	<ul class="aw-assest-form aw-bg-fff aw-mt15">
		<li class="aw-form-li">
			<div class="aw-left">昵称</div>
			<div class="aw-conter">
				<input type="text" placeholder="请输入昵称" id="nickname" name="nickname" v-model="form.nickname" :value="form.nickname">
			</div>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">生日</div>
			<div class="aw-conter aw-pr20">
				<input type="text" placeholder="请选择生日" id="birthday" name="birthday" v-model="form.birthday" :value="form.birthday" readonly="readonly">
			</div>
			<div class="aw-icon aw-icon-more aw-right"></div>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">年龄</div>
			<div class="aw-conter">
				<input type="text" placeholder="请输入年龄" id="age" name="age" v-model="form.age" :value="form.age">
			</div>
		</li>
	</ul>
	<!--表单-结束-->
</div>
<div class="aw-bg-fff aw-foot-btn aw-foot-btn2">
	<a href="javascript:;" class="aw-assest-btn aw-btn-bgcolor-lvse" v-on:click="Save_Info()">保存修改</a>
</div>

@section('pagejs')
@parent
<!--手机端日期插件-->
<link href="/wap/js/mobiscroll/mobiscroll.css" rel="stylesheet" type="text/css">
<link href="/wap/js/mobiscroll/mobiscroll_color.css" rel="stylesheet" type="text/css">
<link href="/wap/js/mobiscroll/mobiscroll_android.css" rel="stylesheet" type="text/css">
<script src="/wap/js/mobiscroll/mobiscroll_base.js" type="text/javascript"></script>
<script src="/wap/js/mobiscroll/mobiscroll_cn.js" type="text/javascript"></script>
<script src="/wap/js/mobiscroll/mobiscroll.js" type="text/javascript"></script>
<style>
.dwbc-p .dwbw{width: 33.33%;}
.android-ics .dw .dwb-a{background:#1BC96C !important;}
</style>
<script type="text/javascript">
var MJS_User_Info=GBC_User_Info;
var Vue_Data={
	form:{nickname:MJS_User_Info.nickname,age:MJS_User_Info.age,birthday:MJS_User_Info.birthday,},
}
$(document).on('click','#birthday',function(){
	$(this).blur()
})
vm=new Vue({
	el:'#Vue-body',
	data:Vue_Data,
	methods:{
		Save_Info:function(){
			var AD_info={
				api:'/api/user/user-save',
				form_data:this.form,
				tips:'修改成功',
				to_url:'/wap/user/info',
			}
			this.form.birthday=$('#birthday').val()
			Form_Verification('#Vue-body',this.form,'birthday',function(ver_code){
				if(ver_code==1){
					postData(AD_info,function(ajax_data){
						$.extend(MJS_User_Info,vm.form);
						Post_Browser_Cache('user_info',MJS_User_Info)
					})
				}
			})
		}
	}
})
$(function(){
	var currYear = (new Date()).getFullYear() - 10;	
	var opt={};
	opt.date = {preset : 'date'};
	opt.datetime = {preset : 'datetime'};
	opt.time = {preset : 'time'};
	opt.default = {
		theme: 'android-ics light', //皮肤样式
	    display: 'modal', //显示方式 
		mode: 'scroller', //日期选择模式
		dateFormat: 'yyyy-mm-dd',
		lang: 'zh',
		showNow: true,
		nowText: "今天",
        startYear: currYear - 50, //开始年份
        endYear: currYear, //结束年份
        onSelect:function(valueText,inst){
	  		vm.form.birthday = valueText;
	  	}
	};
  	$("#birthday").mobiscroll($.extend(opt['date'], opt['default']));
});
</script>
@endsection

@endsection

